home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 12 / Amiga Format AFCD12 (Apr 1997, Issue 96).iso / -readerstuff- / manolis_pappas / mathfx / examples / symbols1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-29  |  1.1 KB  |  56 lines

  1. /* Displays the plotter symbols for FXPOIN function. */
  2. /* Copyright (©) 1995, The Xperts Group Inc. All Rights Reserved. */
  3. /* Author: Manolis S Pappas. */
  4.  
  5. #include <stdio.h>
  6.  
  7. main()
  8. {
  9.       char text[3];
  10.       int i, j, k;
  11.       float x, y;
  12.  
  13. /* Full sized page for display */
  14.  
  15.       fxstar(1,1);
  16.       fxadv(0);
  17.  
  18. /* Set up viewport and window */
  19.  
  20.       fxvpor(0.1,1.0,0.1,0.9);
  21.       fxwind(0.0,1.0,0.0,1.3);
  22.  
  23. /* Draw the grid using plbox */
  24.  
  25.       fxbox("bcgt",0.1,0,"bcgt",0.1,0);
  26.  
  27. /* Write the digits below the frame */
  28.  
  29.       for (i=0; i<=9; i++) {
  30.         sprintf(text,"%d",i);
  31.         fxmtex("b",1.5,0.1*i+0.05,0.5,text);
  32.       }
  33.     
  34.       k=0;
  35.       for (i=0; i<=12; i++)  {
  36.  
  37. /* Write the digits to the left of the frame */
  38.  
  39.         sprintf(text,"%d",10*i);
  40.         fxmtex("lv",1.0,1.0-(2*i+1)/26.0,1.0,text);
  41.         for (j=0; j<=9; j++) {
  42.           x=0.1*j+0.05;
  43.           y=1.25-0.1*i;
  44.  
  45. /* Display the symbols (fxpoin expects that x and y are arrays so */
  46. /* pass pointers) */
  47.  
  48.           if (k < 128) fxpoin(1,&x,&y,k);
  49.           k=k+1;
  50.         }
  51.       }
  52.  
  53.       fxmtex("t",1.5,0.5,0.5,"FXPOIN symbol library.");
  54.       fxend();
  55. }
  56.